
class Base{
    public int a;
    public int b;
    public int c = 199;

    public void methodBase(){

        System.out.println("Bese");
    }


}
class Derived extends Base {

    public   int c = 9;

    public Derived(int c) {
        this.c = c;
    }

    public void methodDerived(){
        System.out.println("Derived");
    }
    public void methodBase(){
        System.out.println("Derived");
    }
    public void func(){
        super.methodBase();
        methodDerived();
    }
    public void func1(){
        //子类有就那子类的，子类没有就拿父类的
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);//如果子类和父类有同名，优先选择子类
        System.out.println(super.c);//super 暂且代表父类的引用
    }
}

public class Main {
    public static void main(String[] args) {
        Derived derived = new Derived(2);
        derived.func();
    }

}